'''
=========================
!/usr/bin/env python
_*_ coding:utf-8 _*_

@Time : 2020/7/24 11:03
@Coder: xh
@IDE  : PyCharm
=========================
'''
import time
from selenium import webdriver

options = webdriver.ChromeOptions()
# options.add_experimental_option('excludeSwitches', ['enable-automation'])
driver = webdriver.Chrome(options=options)
driver.execute_cdp_cmd("Page.addScriptToEvaluateOnNewDocument", {
  "source": """
    Object.defineProperty(navigator, 'webdriver', {
      get: () => undefined
    })
  """
})
driver.implicitly_wait(10)
begin_url = 'https://www.qdaily.com/tags/29.html'
driver.get(begin_url)

title = driver.find_element_by_xpath('/html/body/div[2]/div[1]/div[1]/a/div[2]/div/h3').text.strip('大公司头条：')
news_1,news_2= title.split('；')
print(news_1)
next_url = driver.find_element_by_xpath('/html/body/div[2]/div[1]/div[1]/a').get_attribute('href')
driver.get(next_url)
time.sleep(3)

news = driver.find_e
print(news)
driver.close()